Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split shares KV table #2140

Merged
merged 51 commits into from
Feb 4, 2021
Merged

Conversation

jumaffre
Copy link
Contributor

@jumaffre jumaffre commented Feb 1, 2021

Part of #1648

To be able to retrieve historical ledger secrets, CCF must know the version at which a ledger secret was recorded in the KV. Once #2137 is merged, we will be able to record this in the store and recover historical ledger secrets.

The issue was that the ccf.shares table was also updated on pure re-share (i.e. reshuffling the recovery shares without refreshing the ledger secret), which meant that we would have to do extra round trips to recover the ledger secrets.

The ccf.shares now is split into the ccf.encrypted_ledger_secrets to record the previous encrypted ledger secret + version + version at which it was recorded in the store (unused for now, waiting for #2137) + version of the next ledger secret (useful for recovery). The ccf.shares still contains the latest ledger secret encrypted with the ledger secret wrapping key and the corresponding recovery shares, encrypted with each member's public encryption key.

Also tidied up and simplified of bunch of things so that the recovery flow is hopefully a little cleaner.

@jumaffre jumaffre requested a review from a team as a code owner February 1, 2021 09:37
@ccf-bot
Copy link
Collaborator

ccf-bot commented Feb 1, 2021

recovery_historical_secrets@18512 aka 20210204.18 vs master ewma over 50 builds from 17789 to 18502
images

src/node/node_state.h Outdated Show resolved Hide resolved
src/node/node_state.h Outdated Show resolved Hide resolved
src/node/share_manager.h Outdated Show resolved Hide resolved
src/node/share_manager.h Outdated Show resolved Hide resolved
src/node/share_manager.h Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants